#include "widget.h"
#include "ui_widget.h"
#include<QDebug>
#include<QMouseEvent>


Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    this->setMouseTracking(true);//把此选项设置为true才能追踪  鼠标移动

}

Widget::~Widget()
{
    delete ui;
}

void Widget::mouseMoveEvent(QMouseEvent *event)
{
    qDebug()<<event->x()<<","<<event->y();
}

